-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create drawAuras hook #15450
Create drawAuras hook #15450
Conversation
augury for this says "woe" |
Elaborate? |
I might be amenable if there's no other recourse to a drawAuras hook that passes in the previous slugs as an argument, but doing the computation ourselves in what is already performance sensitive code just in case a module uses it isn't something I could really agree with. |
So using this PR as an example, it would be a hook that provides the So something akin to async reset(slugs?: string[]): Promise<void> {
const preUpdateSlugs = Array.from(this.keys());
...
return this.draw().then(() => Hooks.callAll("drawAuras", this.token, preUpdateSlugs));
} |
I would await instead of using then, but yes, though perhaps in an object, so I don't mind if its before or after, whichever follows the pattern of most draw/render hooks. |
I would use await as well if it was possible to have code run after returning it lol As for running it before, it sounds somewhat counter to the name of |
its a |
TIL Making the changes. |
As awkward as it may be to work around, remove the preUpdateSlugs. It has more of a chance going through without it. I'll do research on existing hooks to see if we need to change the name as well.
|
As a note, I have removed the preUpdateSlugs. The changeset is now just adding a |
I've reconnected after, and without the diffing of before/after or some way to even store what it was before, this PR has no use. It would be better served by a post prepared hook, which would be able to handle this situation. I'd recommend asking core foundry for such a hook though. |
Creates 3 informational hooks,
deletedAuras
,createdAuras
, andupdatedAuras
. Hopefully self-explanatory.The arguments they give are the
AuraRenderers
object itself, and then an array of slugs of the auras that were somehow changed.Primarily for use with the WIP PF2e Graphics module, such as animating size-changing auras. Ex. Issue MrVauxs/pf2e-jb2a-macros#157